<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TabBar Test Page</title>
<script src="offset.js"></script>
<head>
<body style="margin:10px">
	<div id="d1" style="margin:20px;width:200px;height:100px;border:5px solid #000;overflow:auto">
		<div id="d2" style="width:100px;height:20px;border:1px solid #ccc;margin:10px 200px;">hello</div>
	</div>
	<input type="button" onclick="show()" value="show"/>
	<div id="result" style="width:200px;height:200px;border:1px solid #000"></div>
	<script>
		(show = function () {
			var o = offset(document.getElementById('d2'));
			show.result.innerHTML = [
			'left:' + o.left + ';top:' + o.top, '<br/>'
			];
		}).result = document.getElementById('result');
		
		function foo (a) {
			this.a = 2;
			return foo.fn.init(a);
		}
		
		foo.fn = foo.prototype = {
			init : function (a) {
				this.a = a;
				return 3;	
			},
			b : function () {
				alert(this.a);	
			}	
		};
		
		var f1 = foo(3), f2 = foo(4);
		alert(f1);
		
	</script>
</body>
</html>